package com.nenude.corejava.ch8.homework;

import java.util.Scanner;

public class TestData {
	Scanner scanner=new Scanner(System.in);
	int b=scanner.nextInt();
	
	public void testdata() throws ByteSizeException {
		// -128-127
		if (b < -128 || b > 127) {
			throw new ByteSizeException("不是byte类型");
		}
		else{
			System.out.println("是byte类型");
		}
	}

	public static void main(String[] args) {
		System.out.println("输入一个数：");
		TestData data = new TestData();
		try {
			data.testdata();
		} catch (ByteSizeException e) {
			e.printStackTrace();
		}
	}

}
